home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / share / awk / readable.awk < prev    next >
Text File  |  2005-10-13  |  443b  |  17 lines

  1. # readable.awk --- library file to skip over unreadable files
  2. #
  3. # Arnold Robbins, arnold@gnu.org, Public Domain
  4. # October 2000
  5.  
  6. BEGIN {
  7.     for (i = 1; i < ARGC; i++) {
  8.         if (ARGV[i] ~ /^[A-Za-z_][A-Za-z0-9_]*=.*/ \
  9.             || ARGV[i] == "-")
  10.             continue    # assignment or standard input
  11.         else if ((getline junk < ARGV[i]) < 0) # unreadable
  12.             delete ARGV[i]
  13.         else
  14.             close(ARGV[i])
  15.     }
  16. }
  17.